<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - dnn_mmod_dog_hipsterizer.cpp</title></head><body bgcolor='white'><pre>
<font color='#009900'>// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
</font><font color='#009900'>/*
    This example shows how to run a CNN based dog face detector using dlib.  The
    example loads a pretrained model and uses it to find dog faces in images.
    We also use the dlib::shape_predictor to find the location of the eyes and
    nose and then draw glasses and a mustache onto each dog found :)
    

    Users who are just learning about dlib's deep learning API should read the
    <a href="dnn_introduction_ex.cpp.html">dnn_introduction_ex.cpp</a> and <a href="dnn_introduction2_ex.cpp.html">dnn_introduction2_ex.cpp</a> examples to learn how
    the API works.  For an introduction to the object detection method you
    should read <a href="dnn_mmod_ex.cpp.html">dnn_mmod_ex.cpp</a>


    
    TRAINING THE MODEL
        Finally, users interested in how the dog face detector was trained should
        read the <a href="dnn_mmod_ex.cpp.html">dnn_mmod_ex.cpp</a> example program.  It should be noted that the
        dog face detector used in this example uses a bigger training dataset and
        larger CNN architecture than what is shown in <a href="dnn_mmod_ex.cpp.html">dnn_mmod_ex.cpp</a>, but
        otherwise training is the same.  If you compare the net_type statements
        in this file and <a href="dnn_mmod_ex.cpp.html">dnn_mmod_ex.cpp</a> you will see that they are very similar
        except that the number of parameters has been increased.

        Additionally, the following training parameters were different during
        training: The following lines in <a href="dnn_mmod_ex.cpp.html">dnn_mmod_ex.cpp</a> were changed from
            mmod_options options(face_boxes_train, 40,40);
            trainer.set_iterations_without_progress_threshold(300);
        to the following when training the model used in this example:
            mmod_options options(face_boxes_train, 80,80);
            trainer.set_iterations_without_progress_threshold(8000);

        Also, the random_cropper was left at its default settings,  So we didn't
        call these functions:
            cropper.set_chip_dims(200, 200);
            cropper.set_min_object_size(40,40);

        The training data used to create the model is also available at 
        http://dlib.net/files/data/CU_dogs_fully_labeled.tar.gz

        Lastly, the shape_predictor was trained with default settings except we
        used the following non-default settings: cascade depth=20, tree
        depth=5, padding=0.2
*/</font>


<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>iostream<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>dnn.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>data_io.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>image_processing.h<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>dlib<font color='#5555FF'>/</font>gui_widgets.h<font color='#5555FF'>&gt;</font>


<font color='#0000FF'>using</font> <font color='#0000FF'>namespace</font> std;
<font color='#0000FF'>using</font> <font color='#0000FF'>namespace</font> dlib;

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'><u>long</u></font> num_filters, <font color='#0000FF'>typename</font> SUBNET<font color='#5555FF'>&gt;</font> <font color='#0000FF'>using</font> con5d <font color='#5555FF'>=</font> con<font color='#5555FF'>&lt;</font>num_filters,<font color='#979000'>5</font>,<font color='#979000'>5</font>,<font color='#979000'>2</font>,<font color='#979000'>2</font>,SUBNET<font color='#5555FF'>&gt;</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'><u>long</u></font> num_filters, <font color='#0000FF'>typename</font> SUBNET<font color='#5555FF'>&gt;</font> <font color='#0000FF'>using</font> con5  <font color='#5555FF'>=</font> con<font color='#5555FF'>&lt;</font>num_filters,<font color='#979000'>5</font>,<font color='#979000'>5</font>,<font color='#979000'>1</font>,<font color='#979000'>1</font>,SUBNET<font color='#5555FF'>&gt;</font>;

<font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> SUBNET<font color='#5555FF'>&gt;</font> <font color='#0000FF'>using</font> downsampler  <font color='#5555FF'>=</font> relu<font color='#5555FF'>&lt;</font>affine<font color='#5555FF'>&lt;</font>con5d<font color='#5555FF'>&lt;</font><font color='#979000'>32</font>, relu<font color='#5555FF'>&lt;</font>affine<font color='#5555FF'>&lt;</font>con5d<font color='#5555FF'>&lt;</font><font color='#979000'>32</font>, relu<font color='#5555FF'>&lt;</font>affine<font color='#5555FF'>&lt;</font>con5d<font color='#5555FF'>&lt;</font><font color='#979000'>16</font>,SUBNET<font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font>;
<font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> SUBNET<font color='#5555FF'>&gt;</font> <font color='#0000FF'>using</font> rcon5  <font color='#5555FF'>=</font> relu<font color='#5555FF'>&lt;</font>affine<font color='#5555FF'>&lt;</font>con5<font color='#5555FF'>&lt;</font><font color='#979000'>45</font>,SUBNET<font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font>;

<font color='#0000FF'>using</font> net_type <font color='#5555FF'>=</font> loss_mmod<font color='#5555FF'>&lt;</font>con<font color='#5555FF'>&lt;</font><font color='#979000'>1</font>,<font color='#979000'>9</font>,<font color='#979000'>9</font>,<font color='#979000'>1</font>,<font color='#979000'>1</font>,rcon5<font color='#5555FF'>&lt;</font>rcon5<font color='#5555FF'>&lt;</font>rcon5<font color='#5555FF'>&lt;</font>downsampler<font color='#5555FF'>&lt;</font>input_rgb_image_pyramid<font color='#5555FF'>&lt;</font>pyramid_down<font color='#5555FF'>&lt;</font><font color='#979000'>6</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font>;

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<font color='#0000FF'><u>int</u></font> <b><a name='main'></a>main</b><font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font> argc, <font color='#0000FF'><u>char</u></font><font color='#5555FF'>*</font><font color='#5555FF'>*</font> argv<font face='Lucida Console'>)</font> <font color='#0000FF'>try</font>
<b>{</b>
    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>argc <font color='#5555FF'>&lt;</font> <font color='#979000'>3</font><font face='Lucida Console'>)</font>
    <b>{</b>
        cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>Call this program like this:</font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> endl;
        cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>./dnn_mmod_dog_hipsterizer mmod_dog_hipsterizer.dat faces/dogs.jpg</font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> endl;
        cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>\nYou can get the mmod_dog_hipsterizer.dat file from:\n</font>";
        cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>http://dlib.net/files/mmod_dog_hipsterizer.dat.bz2</font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> endl;
        <font color='#0000FF'>return</font> <font color='#979000'>0</font>;
    <b>}</b>


    <font color='#009900'>// load the models as well as glasses and mustache.
</font>    net_type net;
    shape_predictor sp;
    matrix<font color='#5555FF'>&lt;</font>rgb_alpha_pixel<font color='#5555FF'>&gt;</font> glasses, mustache;
    <font color='#BB00BB'>deserialize</font><font face='Lucida Console'>(</font>argv[<font color='#979000'>1</font>]<font face='Lucida Console'>)</font> <font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font> net <font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font> sp <font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font> glasses <font color='#5555FF'>&gt;</font><font color='#5555FF'>&gt;</font> mustache;  
    <font color='#BB00BB'>pyramid_up</font><font face='Lucida Console'>(</font>glasses<font face='Lucida Console'>)</font>;
    <font color='#BB00BB'>pyramid_up</font><font face='Lucida Console'>(</font>mustache<font face='Lucida Console'>)</font>;

    image_window <font color='#BB00BB'>win1</font><font face='Lucida Console'>(</font>glasses<font face='Lucida Console'>)</font>;
    image_window <font color='#BB00BB'>win2</font><font face='Lucida Console'>(</font>mustache<font face='Lucida Console'>)</font>;
    image_window win_wireframe, win_hipster;

    <font color='#009900'>// Now process each image, find dogs, and hipsterize them by drawing glasses and a
</font>    <font color='#009900'>// mustache on each dog :)
</font>    <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>int</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>2</font>; i <font color='#5555FF'>&lt;</font> argc; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
    <b>{</b>
        matrix<font color='#5555FF'>&lt;</font>rgb_pixel<font color='#5555FF'>&gt;</font> img;
        <font color='#BB00BB'>load_image</font><font face='Lucida Console'>(</font>img, argv[i]<font face='Lucida Console'>)</font>;

        <font color='#009900'>// Upsampling the image will allow us to find smaller dog faces but will use more
</font>        <font color='#009900'>// computational resources.
</font>        <font color='#009900'>//pyramid_up(img); 
</font>
        <font color='#0000FF'>auto</font> dets <font color='#5555FF'>=</font> <font color='#BB00BB'>net</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font>;
        win_wireframe.<font color='#BB00BB'>clear_overlay</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
        win_wireframe.<font color='#BB00BB'>set_image</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font>;
        <font color='#009900'>// We will also draw a wireframe on each dog's face so you can see where the
</font>        <font color='#009900'>// shape_predictor is identifying face landmarks.
</font>        std::vector<font color='#5555FF'>&lt;</font>image_window::overlay_line<font color='#5555FF'>&gt;</font> lines;
        <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'>auto</font><font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font> d : dets<font face='Lucida Console'>)</font>
        <b>{</b>
            <font color='#009900'>// get the landmarks for this dog's face
</font>            <font color='#0000FF'>auto</font> shape <font color='#5555FF'>=</font> <font color='#BB00BB'>sp</font><font face='Lucida Console'>(</font>img, d.rect<font face='Lucida Console'>)</font>;

            <font color='#0000FF'>const</font> rgb_pixel <font color='#BB00BB'>color</font><font face='Lucida Console'>(</font><font color='#979000'>0</font>,<font color='#979000'>255</font>,<font color='#979000'>0</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> top  <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>0</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> lear <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>1</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> leye <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>2</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> nose <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>3</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> rear <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>4</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>auto</font> reye <font color='#5555FF'>=</font> shape.<font color='#BB00BB'>part</font><font face='Lucida Console'>(</font><font color='#979000'>5</font><font face='Lucida Console'>)</font>;

            <font color='#009900'>// The locations of the left and right ends of the mustache.
</font>            <font color='#0000FF'>auto</font> lmustache <font color='#5555FF'>=</font> <font color='#979000'>1.3</font><font color='#5555FF'>*</font><font face='Lucida Console'>(</font>leye<font color='#5555FF'>-</font>reye<font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font> <font color='#5555FF'>+</font> nose;
            <font color='#0000FF'>auto</font> rmustache <font color='#5555FF'>=</font> <font color='#979000'>1.3</font><font color='#5555FF'>*</font><font face='Lucida Console'>(</font>reye<font color='#5555FF'>-</font>leye<font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font color='#979000'>2</font> <font color='#5555FF'>+</font> nose;

            <font color='#009900'>// Draw the glasses onto the image.
</font>            std::vector<font color='#5555FF'>&lt;</font>point<font color='#5555FF'>&gt;</font> from <font color='#5555FF'>=</font> <b>{</b><font color='#979000'>2</font><font color='#5555FF'>*</font><font color='#BB00BB'>point</font><font face='Lucida Console'>(</font><font color='#979000'>176</font>,<font color='#979000'>36</font><font face='Lucida Console'>)</font>, <font color='#979000'>2</font><font color='#5555FF'>*</font><font color='#BB00BB'>point</font><font face='Lucida Console'>(</font><font color='#979000'>59</font>,<font color='#979000'>35</font><font face='Lucida Console'>)</font><b>}</b>, to <font color='#5555FF'>=</font> <b>{</b>leye, reye<b>}</b>;
            <font color='#0000FF'>auto</font> tform <font color='#5555FF'>=</font> <font color='#BB00BB'>find_similarity_transform</font><font face='Lucida Console'>(</font>from, to<font face='Lucida Console'>)</font>;
            <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> r <font color='#5555FF'>=</font> <font color='#979000'>0</font>; r <font color='#5555FF'>&lt;</font> glasses.<font color='#BB00BB'>nr</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>r<font face='Lucida Console'>)</font>
            <b>{</b>
                <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> c <font color='#5555FF'>=</font> <font color='#979000'>0</font>; c <font color='#5555FF'>&lt;</font> glasses.<font color='#BB00BB'>nc</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>c<font face='Lucida Console'>)</font>
                <b>{</b>
                    point p <font color='#5555FF'>=</font> <font color='#BB00BB'>tform</font><font face='Lucida Console'>(</font><font color='#BB00BB'>point</font><font face='Lucida Console'>(</font>c,r<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
                    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#BB00BB'>get_rect</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font>.<font color='#BB00BB'>contains</font><font face='Lucida Console'>(</font>p<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
                        <font color='#BB00BB'>assign_pixel</font><font face='Lucida Console'>(</font><font color='#BB00BB'>img</font><font face='Lucida Console'>(</font>p.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,p.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>, <font color='#BB00BB'>glasses</font><font face='Lucida Console'>(</font>r,c<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
                <b>}</b>
            <b>}</b>

            <font color='#009900'>// Draw the mustache onto the image right under the dog's nose.
</font>            <font color='#0000FF'>auto</font> mrect <font color='#5555FF'>=</font> <font color='#BB00BB'>get_rect</font><font face='Lucida Console'>(</font>mustache<font face='Lucida Console'>)</font>;
            from <font color='#5555FF'>=</font> <b>{</b>mrect.<font color='#BB00BB'>tl_corner</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, mrect.<font color='#BB00BB'>tr_corner</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><b>}</b>;
            to <font color='#5555FF'>=</font> <b>{</b>rmustache, lmustache<b>}</b>;
            tform <font color='#5555FF'>=</font> <font color='#BB00BB'>find_similarity_transform</font><font face='Lucida Console'>(</font>from, to<font face='Lucida Console'>)</font>;
            <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> r <font color='#5555FF'>=</font> <font color='#979000'>0</font>; r <font color='#5555FF'>&lt;</font> mustache.<font color='#BB00BB'>nr</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>r<font face='Lucida Console'>)</font>
            <b>{</b>
                <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>long</u></font> c <font color='#5555FF'>=</font> <font color='#979000'>0</font>; c <font color='#5555FF'>&lt;</font> mustache.<font color='#BB00BB'>nc</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>c<font face='Lucida Console'>)</font>
                <b>{</b>
                    point p <font color='#5555FF'>=</font> <font color='#BB00BB'>tform</font><font face='Lucida Console'>(</font><font color='#BB00BB'>point</font><font face='Lucida Console'>(</font>c,r<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
                    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#BB00BB'>get_rect</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font>.<font color='#BB00BB'>contains</font><font face='Lucida Console'>(</font>p<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
                        <font color='#BB00BB'>assign_pixel</font><font face='Lucida Console'>(</font><font color='#BB00BB'>img</font><font face='Lucida Console'>(</font>p.<font color='#BB00BB'>y</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,p.<font color='#BB00BB'>x</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>, <font color='#BB00BB'>mustache</font><font face='Lucida Console'>(</font>r,c<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
                <b>}</b>
            <b>}</b>


            <font color='#009900'>// Record the lines needed for the face wire frame.
</font>            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>leye, nose, color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>nose, reye, color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>reye, leye, color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>reye, rear, color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>rear, top, color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>top, lear,  color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
            lines.<font color='#BB00BB'>push_back</font><font face='Lucida Console'>(</font>image_window::<font color='#BB00BB'>overlay_line</font><font face='Lucida Console'>(</font>lear, leye,  color<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
        <b>}</b>

        win_wireframe.<font color='#BB00BB'>add_overlay</font><font face='Lucida Console'>(</font>lines<font face='Lucida Console'>)</font>;
        win_hipster.<font color='#BB00BB'>set_image</font><font face='Lucida Console'>(</font>img<font face='Lucida Console'>)</font>;

        cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>Hit enter to process the next image.</font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> endl;
        cin.<font color='#BB00BB'>get</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
    <b>}</b>
<b>}</b>
<font color='#0000FF'>catch</font><font face='Lucida Console'>(</font>std::exception<font color='#5555FF'>&amp;</font> e<font face='Lucida Console'>)</font>
<b>{</b>
    cout <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> e.<font color='#BB00BB'>what</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> endl;
<b>}</b>





</pre></body></html>